﻿using Microsoft.EntityFrameworkCore.Metadata.Builders;
using WeChat.Entity;

namespace WeChat.EntityFramework.Mapping
{
    /// <summary>
    /// 角色菜单 Mapping
    /// </summary>
    public class RolesMenuMapping : WeChatBaseMap<RolesMenu, int>
    {
        public override void MapperConfigure(EntityTypeBuilder<RolesMenu> builder)
        {
            builder.HasOne(a => a.Roles).WithMany().HasForeignKey(a => a.RolesId);
            builder.HasOne(a => a.Menu).WithMany().HasForeignKey(a => a.MenuId);
        }
    }
}
